#ifndef CURVEPROPERTIES_H
#define CURVEPROPERTIES_H

#include <vector>
#include <QPointF>
#include <QColor>
#include "Curves/Factories/curvefactory.h"

using namespace std;

class CurveProperties
{
private:
    /* Fields. */
    bool is_active;

    QColor mouseover_color;
    QColor selected_point_color;
    QColor point_color;
    QColor split_point_color;
    QColor active_point_color;
    QColor curve_color;
    QColor polyline_color;
    QColor convex_hull_color;
    QColor selection_color;
    QColor selection_border_color;

    float curve_thickness;
    float point_radius;

    int no_of_segments;
    int selected_point;

    bool draw_curve;
    bool draw_control_points;
    bool draw_control_polyline;
    bool draw_convex_hull;
    bool draw_selection_box;

    QPointF topLeft;
    QPointF bottomRight;
    CurveType cType;

public:
    /* Constructor. */
    CurveProperties( CurveType cType );
    ~CurveProperties();
    QColor MouseOverColor( ) const;
    QColor SelectedPointColor( ) const;
    QColor PointColor( ) const;
    QColor SplitPointColor( ) const;
    void SetCurveColor( QColor newColor );
    QColor CurveColor( ) const;
    QColor PolylineColor( ) const;
    QColor ConvexHullColor( ) const;
    QColor SelectionColor( ) const;
    QColor SelectionBorderColor( ) const;

    void  SetCurveThickness( float newThickness );
    float CurveThickness( ) const;
    float PointRadius( ) const;
    void SetSelectedPoint( int selected_point_index );
    int SelectedPoint( ) const;

    void SetNumberOfSegments( int num );
    int  NumberOfSegments( ) const;

    void ActivateCurve( );
    void DeactivateCurve( );

    void ShowCurve( );
    void ShowCurve( bool );
    void HideCurve( );

    void ShowControlPoints( );
    void ShowControlPoints( bool );
    void HideControlPoints( );

    void ShowControlPolyline( );
    void ShowControlPolyline( bool );
    void HideControlPolyline( );

    void ShowConvexHull( );
    void ShowConvexHull( bool );
    void HideConvexHull( );

    void ShowSelectionBox( );
    void ShowSelectionBox( bool );
    void HideSelectionBox( );

    void ClearBorders( );
    void ExtendBorders( QPointF point );
    void SetBorders( vector< QPointF > points );
    void SetBorders( double left, double right, double top, double bottom );
    QPointF* Borders( ) const;

    bool DrawCurve( ) const;
    bool DrawControlPoints( ) const;
    bool DrawControlPolyline( ) const;
    bool DrawConvexHull( ) const;
    bool DrawSelectionBox( ) const;

    CurveType Type( );
};

#endif // CURVEPROPERTIES_H
